-- get_value_data_by_name
--
local import = import
---@type behavior_ret
local bret = import("bt/bt_plugin/behavior3/behavior_ret")

local M = {
    name = "get_value_data_by_name",
    type = "Action",
    desc = "通过名字取得变量中数据",
    args = {
        { "name", "string", "变量名字" }
    },
    input = { "变量" },
    output = { "数据" },
}

function M.run(node, env, value)
    local name = node.args.name
    if value[name] then
        return bret.SUCCESS, value[name]
    end
    return bret.FAIL
end

return M
